/** 
 * Copyright (C) 2012 Foxit Corporation. 
 * All Rights Reserved.
 *
 * The following code is copyrighted and contains proprietary information and trade secrets of Foxit Corporation.
 * You can only redistribute files listed below to customers of your application, under a written SDK license agreement with Foxit. 
 * You cannot distribute any part of the SDK to general public, even with a SDK license agreement. 
 * Without SDK license agreement, you cannot redistribute anything.
 * 
 * @file	fgs.h
 * @brief	Header file for the Base Data module.
 * @details	This is the base module in this SDK. Other modules all depend on this base module.
 *			It contains:<br>
 *			1. Definitions of basic data types used in this SDK.
 *			2. Methods for initializiing the SDK.
 *			3. Methods for loading font.
 *			4. Methods for memory manager.
 *			5. Methods for stream operate.
 *			6. Methods for Base64 encode and decode.
 * @note	If you want to purchase Foxit PDF SDK license and use ANY of the following functions, please
 *			request for enabling Base Data module explicitly. 
 */

/**
 * @addtogroup FGS Base Data 
 * @brief Definitions and Methods in this module are included in fgs.h.
 */
/**@{*/

#ifndef __FGS__
#define __FGS__

#import <CoreFoundation/CoreFoundation.h>
#import <CoreGraphics/CoreGraphics.h>

#if defined(__cplusplus)
extern "C" {
#endif

/** 
 * @name FGS Enumeration Types
 */
/**@{*/
/**
 * @brief Enum definitions for error codes.
 */
enum {
	/** Success. */
    kFGSErrorSuccess,
	/** Out of memory. */
    kFGSErrorMemory,
	/** Error of any kind, without specific reason. */
    kFGSErrorError,
	/** Incorrect password. */
    kFGSErrorPassword,
	/** File or data format error. */
    kFGSErrorFormat,
	/** File access error. */
    kFGSErrorFile,
	/** Parameter error. */
    kFGSErrorParam,
	/** Not in correct status. */
    kFGSErrorStatus,
	/** To be continued. */
    kFGSErrorToBecontinued,
	/** Search result not found. */
    kFGSErrorNoFound,
	/** Returned when FGSPDFPageRef has not been parsed by ::FGSPDFPageStartParsingPage. */
    kFGSErrorUnParsedPage,
	/** Returned when there is no text information in the PDF page. */
    kFGSErrorNoTextOnPage,
    /** Indicate that the input parameter is out of range. */
	kFGSErrorParamOutOfRange,
	/** Returned when the type is not correct.*/
	kFGSErrorType,
	/** This document is encrypted by some unsupported security handler. */
	kFGSErrorHandler,
	/** This document is encrypted by digital certificate and current user doesn't have correct certificate. */ 
	kFGSErrorCert,
	/** 
	 * License might be invalid, if the return value is ::kFGSErrorInvalidLicense, check if ::FGSLibraryUnlock was properly called. If the return value is still ::kFGSErrorInvalidLicense, please contact Foxit at sales@foxitsoftware.com or support@foxitsoftware.com.
	 */
    kFGSErrorInvalidLicense = 0x80
};
/** @brief Alias of enumeration for error codes. */
typedef UInt32 FGSErrorRet;
/**@}*/

/**
 * @brief System or File font reference type.
 */
typedef const struct __FGSFont * FGSFontRef;

/** 
 * @name FGS Enumeration Types
 */
/**@{*/
/**
 * @brief Enum definitions for font style flags.
 */
enum {
	/** Fixed pitch . */
    kFGSFontFixedPitch   = 0x01,
	/** Serif. */
    kFGSFontSerif        = (1L << 1),
	/** Symbolic. */
    kFGSFontSymbolic     = (1L << 2),
	/** Scrcript. */
    kFGSFontScript       = (1L << 3),
	/** Nonsymbolic. */
    kFGSFontNonSymbolic  = (1L << 5),
	/** Italic. */
    kFGSFontItalic       = (1L << 6),
	/** All cap. */
    kFGSFontAllCap       = (1L << 16),
	/** Small cap. */
    kFGSFontSmallCap     = (1L << 17),
	/** Forced bold. */
    kFGSFontForceBold    = (1L << 18)
};
/** @brief Alias of enumeration for font style flags. */
typedef UInt32 FGSFontStyle;

/**
 * @brief Enum Definitions for charset flags.
 */
enum {
	/** Default. */
    kFGSCharsetDefault   = 0,
	/** For simplified Chinese. */
    kFGSCharsetGB        = 936,
	/** For traditional Chinese. */
    kFGSCharsetBig5      = 950,
	/** For Japanese. */
    kFGSCharsetJIS       = 932,
	/** For Korea. */
    kFGSCharsetKorea     = 949,
	/** Unicode. */
    kFGSCharsetUnicode   = 1200
};
/** @brief Alias of enumeration for font charset flags. */
typedef UInt32 FGSCharset;
/**@}*/

/**
 * @brief Interface for providing glyph bitmap of non-latin characters.
 *		  This is usually used for embedded devices with Chinese/Japanese/Korean 
 *		  fonts installed, but those fonts are not in TrueType or Type1 format.
 */
typedef struct __FGSGlyphProvider {
	/** @brief The size of the data structure. It must be set to <I>sizeof</I>(::FGSGlyphProvider). */
    UInt32         size;
	/** @brief A user pointer, used by the application. */
	void *		   clientData;
    
	/**
	 * @brief Return an internal handle for a font.
	 * 
	 * @param[in] clientData	The user-supplied data.
	 * @param[in] name			Font name.
	 * @param[in] charset		Charset ID. See macro definitions <b>FGSCharset</b>.
	 * @param[in] flags			Font flags. See macro definitions <b>FGSFontStyle</b>.
	 * @param[in] weight		Weight of the font. Range from 100 to 900. 400 is normal,
	 * 							700 is bold.
	 *
	 * @return	An internal handle to the mapped font. If the embedded device supports
	 *			multiple fonts, then this value can serve as an identifier to differentiate
	 *			among them. If the device supports only one font, then implementation of
	 *			this function can simply return NULL.
	 */
	void *         (*mapFont)(void *clientData, CFStringRef name, FGSCharset charset, FGSFontStyle flags, SInt32 weight);

	/**
	 * @brief Get glyph bounding box.
	 *
	 * @details The bounding box is measure in a glyph coordination system, in which the
	 *			origin is set to character origin, and unit is set to one-thousandth of
	 *			"em size" (representing the font size).<br>
	 *			In most CJK fonts, all CJK characters (except some symbols or western 
	 *			characters) have same glyph bounding box:
	 *			left = 0, right = 1000, bottom = -220, top = 780.<br>
	 *			It's OK to return a box that's larger than the actual glyph box.
	 *
	 * @param[in] clientData	The user-supplied data.
	 * @param[in] font			Internal handle to the font. Returned by MapFont interface.
	 * @param[in] unicode		Unicode of the character.
	 * @param[in] CID			Adobe CID for this character. This is reserved and it should be set 0.
     *
	 * @return The result bounding box. See comments below.
	 */
	CGRect         (*getGlyphBBox)(void *clientData, void *font, UniChar unicode, UInt16 CID);
	/**
	 * @brief Get bitmap of a glyph.
	 *
	 * @details The implementation should write "coverage" data into allocated buffer, one byte 
	 *			for each pixel, from top scanline to bottom scanline, within each scan line, 
	 *			from left pixel to right. Coverage 0 means the pixel is outside the glyph, 
	 *			coverage 255 means the pixel is inside the glyph.<br>
	 *			The "pdfWidth" parameter can be used to scale the character in system font
	 *			horizontally to match the font width specified in PDF. For example, if we have
	 *			a PDF file which requires a character in half-width (pdf_width is 500), but
	 *			in the system font the character has full-width (1000), then the glyph provider
	 *			implementation should scale the font horizontally to half of its original width.
	 *
	 * @param[in] clientData		The user-supplied data.
	 * @param[in] font				Internal handle to the font. Returned by MapFont interface.
	 * @param[in] unicode			Unicode of the character.
	 * @param[in] CID				Adobe CID for this character. This is reserved and it should be set 0.
	 * @param[in] fontWidth         Width of the font em square, measured in device units.
	 * @param[in] fontHeight		Height of the font em square, measured in device units.
	 * @param[out] left				Receiving the left ofFGSet, from the character origin, of the
	 *								result glyph bitmap. Positive value will move the bitmap to
	 *								the right side, negative to the left.
	 * @param[out] top				Receiving the top ofFGSet, from the character origin, of the
	 *	 							result glyph bitmap. Positive value will move the bitmap upward,
	 *								negative downward.
	 * @param[out] bitmapWidth		Receiving number of width pixels in the result bitmap
	 * @param[out] bitmapHeight     Receiving number of height pixels in the result bitmap
	 * @param[out] buffer			Receiving a data buffer pointer, allocated by the implementation.
	 * @param[out] stride			Receiving number of bytes per scanline, in the data buffer.
	 * @param[in] pdfWidth			Width of the character specified in PDF. It is measured in one-
	 *								thousandth of the font width. It can be 0 if width not specified in PDF. 
	 *
	 * @return Non-zero for success. 0 for failure. In this case the glyph can not be displayed.
	 */
	Boolean        (*getGlyphBitmap)(void *clientData, void *font,
								  UniChar unicode, UInt16 CID,
								  Float32 fontWidth, Float32 fontHeight, SInt32 *left, SInt32 *top,
								  SInt32 *bitmapWidth, SInt32 *bitmapHeight, 
								  void **buffer, SInt32 *stride, SInt32 pdfWidth);
} FGSGlyphProvider;

/**
 * @brief Defines interface for system font mapper.
 * @note This should be declared to be a global variable.
 */
typedef struct __FGSFontFileMapper {
	/** @brief The size of the data structure. It must be set to <I>sizeof</I>(::FGSFontFileMapper). */
    UInt32         size;
	/** @brief A user pointer, used by the application. */
	void *		   clientData;
	/**
	 * @brief Find font file path for a particular PDF font
	 *
	 * @param[in] clientData	The user-supplied data.
	 * @param[in] name			Font name.
	 * @param[in] charset		Charset ID. See macro definitions <b>FGSCharset</b>.
	 * @param[in] flags			Font flags. See macro definitions <b>FGSFontStyle</b>.
	 * @param[in] weight		Weight of the font. Range from 100 to 900. 400 is normal,
	 * 							700 is bold.
	 * @param[out] path			Pointer to a <b>CFStringRef</b> object that receiving the full file path.
	 * @param[out] faceIndex	Pointer to a <b>SInt32</b> receiving an zero-based index value for the font face, if the 
	 * 							mapped font file is a "collection" (meaning a number of faces 
	 *							are stored in the same file). If the font file is not a 
	 *							collection, the index value should be zero.
	 *
	 * @return	Non-zero for a substitution font has be specified.
	 *			Zero if the mapper doesn't map the font, or something is wrong.
	 */
    Boolean        (*mapFont)(void *clientData, CFStringRef name, FGSCharset charset, FGSFontStyle flags, SInt32 weight,
						   CFStringRef *path, SInt32 *faceIndex);
} FGSFontFileMapper;

/**
 * @brief Defines interface for system font mapper.
 */
typedef struct __FGSFontDataMapper {
	/** @brief The size of the data structure. It must be set to <I>sizeof</I>(::FGSFontDataMapper). */
    UInt32         size;
	/** @brief A user pointer, used by the application. */
	void *		   clientData;
	/**
	 * @brief Find font Data for a particular PDF font.
	 *
	 * @param[in] clientData	The user-supplied data.
	 * @param[in] name			The font name.
	 * @param[in] charset		Charset ID. See macro definitions <b>FGSCharset</b>.
	 * @param[in] flags			Font flags. See macro definitions <b>FGSFontStyle</b>. 
	 * @param[in] weight		Weight of the font. Range from 100 to 900. 400 is normal,
	 * 							700 is bold.
	 * @param[out] fontdata		Pointer to a <b>UInt8</b> that receiving the external data.
	 * @param[out] len          Pointer to a <b>UInt32</b> that receiving the length of the external data.
 	 * @param[out] faceIndex	Pointer to a <b>UInt32</b> that receiving an zero-based index value for the font face, if the 
	 * 							mapped font file is a "collection" (meaning a number of faces 
	 *							are stored in the same file). If the font file is not a 
	 *							collection, the index value should be zero.
	 *
	 * @return	Non-zero for a substitution font has be specified.
	 *			Zero if the mapper doesn't map the font, or something is wrong.
	 */
	Boolean        (*mapFont)(void *clientData, CFStringRef name, FGSCharset charset, FGSFontStyle flags, SInt32 weight,
						   UInt8 *fontdata, UInt32 *len, SInt32 *faceIndex);

} FGSFontDataMapper;

/**
 * @brief Use a system font mapper (typically for Chinese/Japanese/Korean charsets) from file.
 *
 * @details This function is used with devices that come with one or more system fonts,
 *			and those fonts are in standard TT or T1 format.
 *
 * @param[in] mapper			Pointer to a <b>::FGSFontDataMapper</b> structure.
 *
 * @return	::kFGSErrorSuccess means success.<br>
 *			For more definitions please see enum definitions <b>FGSErrorRet</b>.
 *
 */
FGSErrorRet FGSFontSetFontFileMapper(FGSFontFileMapper *mapper);

/**
 * @brief Use a system font mapper (typically for Chinese/Japanese/Korean charsets) from memory.
 *
 * @details This function is used with devices that come with one or more system fonts,
 *			and those fonts are in standard TT or T1 format.
 *
 * @param[in] mapper			Pointer to a <b>::FGSFontDataMapper</b> structure.
 *
 * @return	::kFGSErrorSuccess means success.<br>
 *			For more definitions please see enum definitions <b>FGSErrorRet</b>.
 *
 */
FGSErrorRet FGSFontSetFontDataMapper(FGSFontDataMapper *mapper);

/** 
 * @name FGS Enumeration Types
 */
/**@{*/
/**
 * @brief Enum definitions for encryption algorithm.
 */
enum {
	/** Not use encryption algorithm. */
    kFGSCipherNone,
	/** Use RC4 encryption algorithm. */
    kFGSCipherRC4,
	/** Use AES encryption algorithm. */
    kFGSCipherAES
};
/** @brief Alias of enumeration for encryption algorithm. */
typedef UInt32 FGSCipherFlag;

/**
 * @brief Enum definitions for search flags 
 */
enum {
	/** Whether matching case. */
    kFGSMatchCase        = 1,
	/** Whether matching whole word. */
    kFGSMatchWholeWord   = 2,
	/** (This is not supported now. Maybe this will be supported in a later release.)Whether matching consecutively (for example, "CC" will match twice in "CCC").*/
    kFGSMatchConsecutive = 4,
};
/** @brief Alias of enumeration for search flags. */
typedef UInt32 FGSMathchFlag;
/**@}*/

/**
 * @brief Structure for pausing a progressive process.
 */
typedef struct __FGSPause {        
	/** @brief The user-supplied data. */
    void *		   clientData;
	/**
	 * @brief Check if we need to pause a progressive process now.
	 *
	 * @details Typically implementation of this interface compares the current system tick
	 *		with the previous one, if the time elapsed exceeds certain threshold, then
	 *		the implementation returns <b>TRUE</b>, indicating a pause is needed.
	 *
	 * @param[in] clientData			The user-supplied data.
	 *
	 * @return <b>TRUE</b> means to pause now, while <b>FALSE</b> means to continue.
	 */
    Boolean        (*needPauseNow)(void *clientData);        
} FGSPause;

/**
 * @brief Initialize the sdk library 
 *
 * @return                      None.
 *
 * @note                        This has already been used in <b>::FGSMemoryInitFixedMemory</b>, <b>::FGSMemoryInit</b>, 
 *                              so you don't need to call this function if you've called one of the three functions.
 */
FGSErrorRet FGSLibraryInit();

/**
 * @brief Release all resources allocated by the sdk library.
 *
 * @return                      None.
 *
 * @note                        This has already been used in <b>::FGSMemoryDestroy</b>, so you don't need to call this function</b>
 *                              if you've called <b>::FGSLibraryDestroy</b>.
 */
FGSErrorRet FGSLibraryDestroy();

/**
 * @brief Unlock the library using license key information received from Foxit.
 *
 * @param[in] licenseID         A byte stream received from Foxit identifying the SDK license.
 * @param[in] unlockCode		A byte stream received from Foxit for unlocking the library.
 *
 * @return                      None.
 *
 * @note                        For SDK evaluators, this function call is not required, then all
 *                              rendered pages will come with an evaluation mark.
 *                              For purchased SDK customers, this should be the first function
 *                              to be called after the memory has been initialized.
 */
void FGSLibraryUnlock(CFDataRef licenseID, CFDataRef unlockCode);

/**
 * @brief Initialize the SDK module with the extended memory manager.
 *
 * @details This function will allocate necessary internal data structure for
 *			the whole module to operate.
 *
 * @param[in] allocator			Pointer to memory manager object.
 *
 * @return                      ::kFGSErrorSuccess means initialize  memory successfully.<br>
 *                              For more definitions please see enum definitions <b>FGSErrorRet</b>.
 *
 */
FGSErrorRet FGSMemoryInit(CFAllocatorRef allocator);

/** 
 * @name FGS Enumeration Types
 */
/**@{*/
/**
 * @brief Enum definitions for memory manager flags.
 */
enum {
	/** @brief Fixed memory manager. */
    kFGSMemTypeFixed = 0,
	/** @brief Scalable memory manager. */
    kFGSMemTypeScaleable,
};
/** @brief Alias of enumeration for memory manager flags. */
typedef UInt32 FGSMemType;
/**@}*/

/**
* @brief Initialize the library using an extensible fixed memory manager. With this kind of manager,<br>
*		 when current memory pool runs out, the application may provide some additional memory block<br>
*		 for the manager to use. 
*
* @param[in] size				Number of bytes in the memory block. The size can't be lower than 8MB, <br>
*								there is no upper limit.
* @param[in] type				The type of memory manager.
*
* @return                       ::kFGSErrorSuccess means initialize fixed memory successfully.<br>
*                               For more definitions please see definitions <b>FGSErrorRet</b>.
*
*/	
FGSErrorRet FGSMemoryInitFixedMemory(SInt32 size, FGSMemType type);

/**
 * @brief Free the SDK the extended memory manager and release all resources
 *
 * @details This function is useful for OOM recovery: when your application hits
 *			an OOM situation, calling this function will clear all memory allocated
 *			by Foxit General SDK, then you can call one of the initialization functions,
 *			reopen the document and recovery from OOM.
 *
 * @return                      None.
 */
FGSErrorRet FGSMemoryDestroy();

/**
 * @brief Free all expendable caches used by Foxit General SDK in order to save memory.
 *
 * @details When an application memory manager runs out of memory, the application can try this function before an OOM situation is raised
 *
 * @return                      None.
 */
FGSErrorRet FGSMemoryFreeCaches();

/*
 * @brief Callback for OOM.
*/
typedef void (*FGSOOMCallBack)();

/**
* @brief Set the customer OOM Handler delegate, used when out-of-memory happens.
*
* @param[in] oom                A callback fuction.
* 
* @return                       None.
*/
void FGSOOMSetHandler(FGSOOMCallBack oom);

/**
 * @brief Reference to a read file stream.
 */
typedef const struct __FGSFileStreamIn * FGSFileStreamInRef;

/**
 * @brief To create a input file stream with a string which describes a file.
 *
 * @param[in] file              The path of the file used to create the ::FGSFileStreamInRef object.
 * 
 * @return                      Reference to a stream created by the function.
 */
FGSFileStreamInRef FGSFileStreamInCreateWithFileName(CFStringRef file);

/** 
 * @brief To create a input file stream with a given size of buffer.
 * 
 * @param[in] buffer            The buffer to create file stream with.
 * @param[in] size              The size of the buffer 
 * 
 * @return                      Reference to a stream created by the given buffer.
 */
FGSFileStreamInRef FGSFileReadCreateWithBuffer(void *buffer, UInt32 size);

/** 
 * @brief Get size of the given input file stream.
 * 
 * @param[in] fileStreamIn      The given file stream to get size of .
 * 
 * @return                      An integer which is the size of the file stream.
 */
UInt32 FGSFileStreamInGetSize(FGSFileStreamInRef fileStreamIn);

/** 
 * @brief	Read the data at a certain point into the given buffer.
 * 
 * @param[in]  fileStreamIn		The input file stream to get data from.
 * @param[out] buffer			Pointer to a buffer that receive data get from the given point.
 * @param[in] offset			The offset of the buffer.
 * @param[in] size				The number of bytes to be read from stream.
 * 
 * @return                      ::kFGSErrorSuccess means initialize  memory successfully.<br>
 *                              For more definitions please see enum definitions <b>FGSErrorRet</b>.
 */
FGSErrorRet FGSFileStreamInReadDataAtPos(FGSFileStreamInRef fileStreamIn, void *buffer, UInt32 offset, UInt32 size);

/** 
 * @brief Read the data from a given input file stream.
 * 
 * @param[in]  fileStreamIn		The file stream to read data from.
 * @param[out] buffer			Pointer to a buffer that receive data get from the given point.
 * @param[in] size				The size of the buffer to contain the data.
 * 
 * @return                      The size of data read from stream.
 */
UInt32 FGSFileStreamInReadData(FGSFileStreamInRef fileStreamIn, void *buffer, UInt32 size);

/** 
 * @brief To release a file stream 
 * 
 * @param[in] fileStreamIn		The file stream to be released.
 * 
 * @return                      None.
 */
void FGSFileStreamInRelease(FGSFileStreamInRef fileStreamIn);

/**
 * @brief Reference to a write file stream.
 */
typedef const struct __FGSFileStreamOut * FGSFileStreamOutRef;

/** 
 * @brief Creating a output file stream with name of the file.
 *  
 * @param[in] file              The path of the given file to create a object of <b>::FGSFileStreamOutRef</b>.
 * 
 * @return                      Reference to a file write stream.
 *
 * @note                        Clear existing contents, size of file is to be 0.
 */
FGSFileStreamOutRef FGSFileStreamOutCreateWithFileName(CFStringRef file);

/** 
 * @brief Get size of the given output file stream.
 * 
 * @param[in] fileStreamOut     The given file stream to get size of.
 * 
 * @return                      An integer which is the size of the output file stream.
 */
UInt32 FGSFileStreamOutGetSize(FGSFileStreamOutRef fileStreamOut);

/** 
 * @brief	Write a data into a certain point in the given buffer.
 * 
 * @param[in] fileStreamOut     The output file stream to put the data into.
 * @param[in] buffer			A buffer containing the given data.
 * @param[in] offset			Offset of the buffer.
 * @param[in] size				Size of the buffer.
 * 
 * @return                      ::kFGSErrorSuccess means initialize memory successfully.<br>
 *                              For more definitions please see enum definitions <b>FGSErrorRet</b>.
 */
FGSErrorRet FGSFileStreamOutWriteDataAtPos(FGSFileStreamOutRef fileStreamOut, void *buffer, UInt32 offset, UInt32 size);

/** 
 * @brief Flush the file write stream.
 * 
 * @param[in] fileStreamOut		The file stream to be released.
 * 
 * @return                      ::kFGSErrorSuccess means initialize  memory successfully.<br>
 *                              For more definitions please see enum definitions <b>FGSErrorRet</b>.
 */
FGSErrorRet FGSFileStreamOutFlush(FGSFileStreamOutRef fileStreamOut);

/** 
 * @brief To release a file write stream.
 * 
 * @param[in] fileStreamOut     The output file stream to be flushed.
 * 
 * @return                      ::kFGSErrorSuccess means initialize  memory successfully.<br>
 *                              For more definitions please see enum definitions <b>FGSErrorRet</b>.
 */
FGSErrorRet FGSFileStreamOutRelease(FGSFileStreamOutRef fileStreamOut);
    
/**
 * @brief Base64-encode the given data.
 *
 *
 * @param[in] src               The data to encode.
 * @param[out] dst              The string to store encode.
 *
 * @return                      ::kFGSErrorSuccess means initialize  memory successfully.<br>
 *                              For more definitions please see enum definitions <b>FGSErrorRet</b>.
 */
FGSErrorRet	FGSBase64EncodeToString(CFDataRef src, CFStringRef *dst);

/**
 * @brief Decode the Base64-encoded data.
 *
 * @param[in] src               The data to decode.
 * @param[out] dst              The buffer to store decode data.
 *
 * @return                      ::kFGSErrorSuccess means initialize  memory successfully.<br>
 *                              For more definitions please see enum definitions <b>FGSErrorRet</b>.
 */
FGSErrorRet FGSBase64Decode(CFDataRef src, CFMutableDataRef dst);
    
/**
 * @brief Set the last error.
 *
 * @param[in] error             The error.
 *
 * @return                      None
 */
void        FGSSetLastError(FGSErrorRet error);

/**
 * @brief Get the last error.
 *
 * @return                      ::kFGSErrorSuccess means initialize  memory successfully.<br>
 *                              For more definitions please see macro definitions <b>::FGSErrorRet</b>.
 */
FGSErrorRet FGSGetLastError();
    
/** @} */
#if defined(__cplusplus)
}
#endif

#endif // __FGS__
/** @} */
